import React from 'react'

const UseRef = () => {
	const [count, setCount] = React.useState('我是useState默认值')

	const counterEl = React.useRef(null)

	const increment = () => {
		// counterEl.current是ref的所在标签包括里面的内容
		console.log(counterEl.current)
		console.log((counterEl.current.innerHTML = '这是使用了useref'))
	}
	return (
		<>
			<div className="nav2">
				<h4>10.useRef的使用,绑定标签</h4>
				<h2 ref={counterEl}>{count}</h2>
				<button onClick={increment}>Hook3点我+</button>
			</div>
		</>
	)
}

export default UseRef
